import { Renderer } from "../engine";
import { Behaviour } from "./Behaviour";
import { Rectangle } from "./math";
import { string } from "./validators/string";

export class TextRenderer extends Behaviour implements Renderer {

    @string()
    text = ''
    @string({
        editorType: 'select', options: [
            { value: 'white', label: "白色" },
            { value: 'black', label: "黑色" },
            { value: 'rgb(23, 147, 139)', label: "自定义颜色1" },
            { value: 'gray', label: "灰色" },
            { value: 'green', label: "绿色" },
            { value: 'yellow', label: "黄色" },
            { value: 'red', label: "红色" },
            { value: 'blue', label: '蓝色' }
        ]
    })
    color = "black";

    measuredTextWidth = 0;

    getBounds(): Rectangle {
        return {
            x: 0,
            y: 0,
            width: this.measuredTextWidth,
            height: 40
        };
    }
}